<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <title>退款</title>
    <link rel="stylesheet" href="/Public/Home/css/memberOrder.css">
    <!--不识别数字为手机-->
<meta name="format-detection" content="telephone=no, email=no"/>
<!--通用js-->
<?php if(isset($signPackage) && !empty($signPackage)){ ?>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js?v=201704270010"></script>
<?php } ?>
<script type="text/javascript" src="/Public/Home/js/require.js"></script>
<script type="text/javascript" src="/Public/Home/js/baseLoading.js?v=201705240001"></script>
<script src="/Public/Home/js/jquery.min.js" ></script>
<script src="/Public/Home/js/pincode-input.js" ></script>
<script src="/Public/Home/js/parabola.js" ></script>
<script src="/Public/Home/js/lazyload/jquery.lazyload.min.js"></script>
<script type="text/javascript">
    _global.isLogin = !!"<?php echo $wx_member_id; ?>";
	var isWxShareDiy = typeof yc_share_diy === "undefined" ? false : yc_share_diy;
	var yc_wx_shareImgPath = "";
	<?php if(isset($weixin_logo) && !empty($weixin_logo)){ ?>
		yc_wx_shareImgPath = "/Uploads/<?php echo ($weixin_logo["image"]); ?>";
	<?php } ?>
    var yc_pass_arr = {'local_id':"<?php echo I('local_id',1);?>",'top_local_id':"<?php echo I('top_local_id',1);?>"};
	if(parseInt(yc_pass_arr["local_id"]) == 21){
		_global.isStopSell = true;
	}
    <?php if(isset($signPackage) && !empty($signPackage)){ ?>
        _global.isWeiXinLoad = true;
        var isEnableLocation = typeof yc_wx_location === "undefined" ? false : yc_wx_location;
        var yc_wx_options = {
            "enableLocation" : isEnableLocation,
            "refuseCallback" : function(){},
            "mapCallback" : function(){},
            "config" : {
                debug: false,
                appId: '<?php echo $signPackage["appId"];?>',
                timestamp: '<?php echo $signPackage["timestamp"];?>',
                nonceStr: '<?php echo $signPackage["nonceStr"];?>',
                signature: '<?php echo $signPackage["signature"];?>',
                jsApiList: [
                    'checkJsApi'
                ]
            }
        };
        var isInHeader = typeof yc_wx_useInHeader === "undefined" ? true : yc_wx_useInHeader;
        if(isInHeader){
            wxAutoConfig(yc_wx_options);
        }
    <?php } ?>
</script>
</head>
<body>
<div class="warp">
    <!--退款top-->
    <div class="member-refund-top member-refund2">
        <i></i>
        <ul class="">
            <li><span>填写退款</span></li>
            <li class="active"><span>受理确认</span></li>
            <li><a href="memberRefund3.html"><span>完成退款</span></a></li>
        </ul>
    </div>
    <!--退款订单的信息-->
    <div class="member-refund-price mgTop">
        <p>
            <label>退款金额：</label>
            <span><?php echo ($refund["price"]); ?></span>
        </p>
        <p>
            <label>退款原因：</label>
            <span><?php echo ($refund["message"]); ?></span>
        </p>
        <p>
            <label>审核结果：</label>
            <span class="red">
                <?php if($refund['status'] == '0'): ?>未通过<?php endif; ?>
                <?php if($refund['status'] == '1'): ?>待审核<?php endif; ?>
                <?php if($refund['status'] == '2'): ?>审核通过<?php endif; ?>
                <?php if($refund['status'] == '7'): ?>取消申请<?php endif; ?>
            </span>
        </p>
    </div>
    <!--退款原因-->
    <div class="refund-mes-form refund-bottom mgTop">
        <div class="refund-mes-title">退款跟踪</div>
        <ul>
            <li class="refund-mes-card">
                <i></i>
                <div class="refund-mes-title">
                    提交申请
                    <span><?php echo get_refund_goods_time($refund['id'], 1);?></span>
                </div>
                <p>退款申请已经提交，客服将在1-2个工作日内受理。</p>
            </li>
            <?php if($refund['status'] == '0'): ?><li class="refund-mes-card mgTop">
                    <i></i>
                    <div class="refund-mes-title">
                        审核未通过
                        <span><?php echo get_refund_goods_time($refund['id'], 0);?></span>
                    </div>
                    <p>你的退款申请已被驳回<br/>如有疑问，请您拨打客服电话 <span class="sp-phone"><?php echo ($mobile); ?></span></p>
                    <p class="mgTop"><a href="javascript:void(0);" class="btn btn-second btn-block reapply">重新申请</a></p>
                </li>
                <?php else: ?>
                <?php if($refund['status'] == '2'): ?><li class="refund-mes-card mgTop">
                        <i></i>
                        <div class="refund-mes-title">
                            审核通过
                            <span><?php echo get_refund_goods_time($refund['id'], 2);?></span>
                        </div>
                        <p>我们会尽快处理你的退款金额<br/>如有疑问，请您拨打客服电话 <span class="sp-phone"><?php echo ($mobile); ?></span></p>
                    </li><?php endif; endif; ?>
            <?php if($refund['status'] == '1'): ?><li class="refund-mes-card mgTop">
                    <p class="mgTop"><a href="javascript:void(0);" class="btn btn-second btn-block cancel_order">取消申请</a></p>
                </li><?php endif; ?>
        </ul>
    </div>
</div>
<!-- 绑定手机弹窗 -->
<div class="alert-popup member-reminder" style="display: none">
    <p>如果您的订单还没有发货，可以拨打 <?php echo ($mobile); ?>联络发货人。</p>
    <p><a href="javascript:void(0);" class="cancel">取消</a><a href="tel://<?php echo ($mobile); ?>" class="confirm">拨打</a></p>
</div>
<script>require(['memberRefund'])</script>
</body>
</html>
<script>
    $('.reapply').click(function () {
        $.post("/MemberRefundGoods/ajaxReplay",
            {
                order_id: "<?php echo ($refund['order_id']); ?>" ,
                id: "<?php echo ($refund['id']); ?>",
                sell: "<?php echo ($sell); ?>"
            },
            function (result) {
            if (result == 1) {
                window.location.reload();
            }else {
                alert('申请失败');
            }
        });
    });
    $('.cancel_order').click(function () {
        $.post("/MemberRefundGoods/ajax_cancel_order",
            {
                order_id: "<?php echo ($refund['order_id']); ?>" ,
                id: "<?php echo ($refund['id']); ?>",
                sell: "<?php echo ($sell); ?>"
            },
            function (result) {
            if (result == 1) {
                window.location.reload();
            }else {
                alert('申请失败');
            }
        });
    });
</script>